3.1078 \(\int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3 \, dx\)

Optimal. Leaf size=141 \[ -\frac {a^2 (c+d \tan (e+f x))^4}{4 d f}+\frac {2 i a^2 (c+d \tan (e+f x))^3}{3 f}+\frac {a^2 (d+i c) (c+d \tan (e+f x))^2}{f}+\frac {2 i a^2 d (c-i d)^2 \tan (e+f x)}{f}+\frac {2 a^2 (d+i c)^3 \log (\cos (e+f x))}{f}+2 a^2 x (c-i d)^3 \]

[Out]

2*a^2*(c-I*d)^3*x+2*a^2*(I*c+d)^3*ln(cos(f*x+e))/f+2*I*a^2*(c-I*d)^2*d*tan(f*x+e)/f+a^2*(I*c+d)*(c+d*tan(f*x+e
))^2/f+2/3*I*a^2*(c+d*tan(f*x+e))^3/f-1/4*a^2*(c+d*tan(f*x+e))^4/d/f

________________________________________________________________________________________

Rubi [A]  time = 0.20, antiderivative size = 141, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3543, 3528, 3525, 3475} \[ -\frac {a^2 (c+d \tan (e+f x))^4}{4 d f}+\frac {2 i a^2 (c+d \tan (e+f x))^3}{3 f}+\frac {a^2 (d+i c) (c+d \tan (e+f x))^2}{f}+\frac {2 i a^2 d (c-i d)^2 \tan (e+f x)}{f}+\frac {2 a^2 (d+i c)^3 \log (\cos (e+f x))}{f}+2 a^2 x (c-i d)^3 \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^2*(c + d*Tan[e + f*x])^3,x]

[Out]

2*a^2*(c - I*d)^3*x + (2*a^2*(I*c + d)^3*Log[Cos[e + f*x]])/f + ((2*I)*a^2*(c - I*d)^2*d*Tan[e + f*x])/f + (a^
2*(I*c + d)*(c + d*Tan[e + f*x])^2)/f + (((2*I)/3)*a^2*(c + d*Tan[e + f*x])^3)/f - (a^2*(c + d*Tan[e + f*x])^4
)/(4*d*f)

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3528

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d
*(a + b*Tan[e + f*x])^m)/(f*m), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3543

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[
(d^2*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Int[(a + b*Tan[e + f*x])^m*Simp[c^2 - d^2 + 2*c*d*Tan[e
 + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] &&  !LeQ[m, -1] &&  !(EqQ[m, 2] && EqQ
[a, 0])

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3 \, dx &=-\frac {a^2 (c+d \tan (e+f x))^4}{4 d f}+\int \left (2 a^2+2 i a^2 \tan (e+f x)\right ) (c+d \tan (e+f x))^3 \, dx\\ &=\frac {2 i a^2 (c+d \tan (e+f x))^3}{3 f}-\frac {a^2 (c+d \tan (e+f x))^4}{4 d f}+\int (c+d \tan (e+f x))^2 \left (2 a^2 (c-i d)+2 a^2 (i c+d) \tan (e+f x)\right ) \, dx\\ &=\frac {a^2 (i c+d) (c+d \tan (e+f x))^2}{f}+\frac {2 i a^2 (c+d \tan (e+f x))^3}{3 f}-\frac {a^2 (c+d \tan (e+f x))^4}{4 d f}+\int \left (2 a^2 (c-i d)^2+2 i a^2 (c-i d)^2 \tan (e+f x)\right ) (c+d \tan (e+f x)) \, dx\\ &=2 a^2 (c-i d)^3 x+\frac {2 i a^2 (c-i d)^2 d \tan (e+f x)}{f}+\frac {a^2 (i c+d) (c+d \tan (e+f x))^2}{f}+\frac {2 i a^2 (c+d \tan (e+f x))^3}{3 f}-\frac {a^2 (c+d \tan (e+f x))^4}{4 d f}-\left (2 a^2 (i c+d)^3\right ) \int \tan (e+f x) \, dx\\ &=2 a^2 (c-i d)^3 x+\frac {2 a^2 (i c+d)^3 \log (\cos (e+f x))}{f}+\frac {2 i a^2 (c-i d)^2 d \tan (e+f x)}{f}+\frac {a^2 (i c+d) (c+d \tan (e+f x))^2}{f}+\frac {2 i a^2 (c+d \tan (e+f x))^3}{3 f}-\frac {a^2 (c+d \tan (e+f x))^4}{4 d f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 8.60, size = 733, normalized size = 5.20 \[ \frac {\sec ^2(e+f x) (a+i a \tan (e+f x))^2 \left (\frac {1}{24} \sec (e) (\cos (2 e)-i \sin (2 e)) \left (-9 c^3 \sin (e+2 f x)+3 c^3 \sin (3 e+2 f x)-3 c^3 \sin (3 e+4 f x)+12 c^3 f x \cos (3 e+2 f x)+3 c^3 f x \cos (3 e+4 f x)+3 c^3 f x \cos (5 e+4 f x)+9 c^3 \sin (e)+54 i c^2 d \sin (e+2 f x)-18 i c^2 d \sin (3 e+2 f x)+18 i c^2 d \sin (3 e+4 f x)-9 c^2 d \cos (3 e+2 f x)-36 i c^2 d f x \cos (3 e+2 f x)-9 i c^2 d f x \cos (3 e+4 f x)-9 i c^2 d f x \cos (5 e+4 f x)-54 i c^2 d \sin (e)+6 \cos (e) \left (3 c^3 f x+c^2 d (-3-9 i f x)+3 c d^2 (-3 f x+2 i)+d^3 (2+3 i f x)\right )+57 c d^2 \sin (e+2 f x)-27 c d^2 \sin (3 e+2 f x)+21 c d^2 \sin (3 e+4 f x)+18 i c d^2 \cos (3 e+2 f x)-36 c d^2 f x \cos (3 e+2 f x)-9 c d^2 f x \cos (3 e+4 f x)-9 c d^2 f x \cos (5 e+4 f x)-63 c d^2 \sin (e)+3 (c-i d)^2 (4 c f x-4 i d f x-3 d) \cos (e+2 f x)-20 i d^3 \sin (e+2 f x)+12 i d^3 \sin (3 e+2 f x)-8 i d^3 \sin (3 e+4 f x)+9 d^3 \cos (3 e+2 f x)+12 i d^3 f x \cos (3 e+2 f x)+3 i d^3 f x \cos (3 e+4 f x)+3 i d^3 f x \cos (5 e+4 f x)+24 i d^3 \sin (e)\right )+2 f x (c-i d)^3 (\cos (2 e)-i \sin (2 e)) \cos ^4(e+f x)-2 (c-i d)^3 (\cos (2 e)-i \sin (2 e)) \cos ^4(e+f x) \tan ^{-1}(\tan (3 e+f x))+(c-i d)^3 (-\sin (2 e)-i \cos (2 e)) \cos ^4(e+f x) \log \left (\cos ^2(e+f x)\right )\right )}{f (\cos (f x)+i \sin (f x))^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^2*(c + d*Tan[e + f*x])^3,x]

[Out]

(Sec[e + f*x]^2*((c - I*d)^3*Cos[e + f*x]^4*Log[Cos[e + f*x]^2]*((-I)*Cos[2*e] - Sin[2*e]) + 2*(c - I*d)^3*f*x
*Cos[e + f*x]^4*(Cos[2*e] - I*Sin[2*e]) - 2*(c - I*d)^3*ArcTan[Tan[3*e + f*x]]*Cos[e + f*x]^4*(Cos[2*e] - I*Si
n[2*e]) + (Sec[e]*(Cos[2*e] - I*Sin[2*e])*(6*(3*c^3*f*x + 3*c*d^2*(2*I - 3*f*x) + d^3*(2 + (3*I)*f*x) + c^2*d*
(-3 - (9*I)*f*x))*Cos[e] + 3*(c - I*d)^2*(-3*d + 4*c*f*x - (4*I)*d*f*x)*Cos[e + 2*f*x] - 9*c^2*d*Cos[3*e + 2*f
*x] + (18*I)*c*d^2*Cos[3*e + 2*f*x] + 9*d^3*Cos[3*e + 2*f*x] + 12*c^3*f*x*Cos[3*e + 2*f*x] - (36*I)*c^2*d*f*x*
Cos[3*e + 2*f*x] - 36*c*d^2*f*x*Cos[3*e + 2*f*x] + (12*I)*d^3*f*x*Cos[3*e + 2*f*x] + 3*c^3*f*x*Cos[3*e + 4*f*x
] - (9*I)*c^2*d*f*x*Cos[3*e + 4*f*x] - 9*c*d^2*f*x*Cos[3*e + 4*f*x] + (3*I)*d^3*f*x*Cos[3*e + 4*f*x] + 3*c^3*f
*x*Cos[5*e + 4*f*x] - (9*I)*c^2*d*f*x*Cos[5*e + 4*f*x] - 9*c*d^2*f*x*Cos[5*e + 4*f*x] + (3*I)*d^3*f*x*Cos[5*e
+ 4*f*x] + 9*c^3*Sin[e] - (54*I)*c^2*d*Sin[e] - 63*c*d^2*Sin[e] + (24*I)*d^3*Sin[e] - 9*c^3*Sin[e + 2*f*x] + (
54*I)*c^2*d*Sin[e + 2*f*x] + 57*c*d^2*Sin[e + 2*f*x] - (20*I)*d^3*Sin[e + 2*f*x] + 3*c^3*Sin[3*e + 2*f*x] - (1
8*I)*c^2*d*Sin[3*e + 2*f*x] - 27*c*d^2*Sin[3*e + 2*f*x] + (12*I)*d^3*Sin[3*e + 2*f*x] - 3*c^3*Sin[3*e + 4*f*x]
 + (18*I)*c^2*d*Sin[3*e + 4*f*x] + 21*c*d^2*Sin[3*e + 4*f*x] - (8*I)*d^3*Sin[3*e + 4*f*x]))/24)*(a + I*a*Tan[e
 + f*x])^2)/(f*(Cos[f*x] + I*Sin[f*x])^2)

________________________________________________________________________________________

fricas [B]  time = 0.47, size = 451, normalized size = 3.20 \[ \frac {-6 i \, a^{2} c^{3} - 36 \, a^{2} c^{2} d + 42 i \, a^{2} c d^{2} + 16 \, a^{2} d^{3} + {\left (-6 i \, a^{2} c^{3} - 54 \, a^{2} c^{2} d + 90 i \, a^{2} c d^{2} + 42 \, a^{2} d^{3}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (-18 i \, a^{2} c^{3} - 144 \, a^{2} c^{2} d + 198 i \, a^{2} c d^{2} + 72 \, a^{2} d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-18 i \, a^{2} c^{3} - 126 \, a^{2} c^{2} d + 150 i \, a^{2} c d^{2} + 58 \, a^{2} d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-6 i \, a^{2} c^{3} - 18 \, a^{2} c^{2} d + 18 i \, a^{2} c d^{2} + 6 \, a^{2} d^{3} + {\left (-6 i \, a^{2} c^{3} - 18 \, a^{2} c^{2} d + 18 i \, a^{2} c d^{2} + 6 \, a^{2} d^{3}\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + {\left (-24 i \, a^{2} c^{3} - 72 \, a^{2} c^{2} d + 72 i \, a^{2} c d^{2} + 24 \, a^{2} d^{3}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (-36 i \, a^{2} c^{3} - 108 \, a^{2} c^{2} d + 108 i \, a^{2} c d^{2} + 36 \, a^{2} d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-24 i \, a^{2} c^{3} - 72 \, a^{2} c^{2} d + 72 i \, a^{2} c d^{2} + 24 \, a^{2} d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{3 \, {\left (f e^{\left (8 i \, f x + 8 i \, e\right )} + 4 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 4 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(c+d*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

1/3*(-6*I*a^2*c^3 - 36*a^2*c^2*d + 42*I*a^2*c*d^2 + 16*a^2*d^3 + (-6*I*a^2*c^3 - 54*a^2*c^2*d + 90*I*a^2*c*d^2
 + 42*a^2*d^3)*e^(6*I*f*x + 6*I*e) + (-18*I*a^2*c^3 - 144*a^2*c^2*d + 198*I*a^2*c*d^2 + 72*a^2*d^3)*e^(4*I*f*x
 + 4*I*e) + (-18*I*a^2*c^3 - 126*a^2*c^2*d + 150*I*a^2*c*d^2 + 58*a^2*d^3)*e^(2*I*f*x + 2*I*e) + (-6*I*a^2*c^3
 - 18*a^2*c^2*d + 18*I*a^2*c*d^2 + 6*a^2*d^3 + (-6*I*a^2*c^3 - 18*a^2*c^2*d + 18*I*a^2*c*d^2 + 6*a^2*d^3)*e^(8
*I*f*x + 8*I*e) + (-24*I*a^2*c^3 - 72*a^2*c^2*d + 72*I*a^2*c*d^2 + 24*a^2*d^3)*e^(6*I*f*x + 6*I*e) + (-36*I*a^
2*c^3 - 108*a^2*c^2*d + 108*I*a^2*c*d^2 + 36*a^2*d^3)*e^(4*I*f*x + 4*I*e) + (-24*I*a^2*c^3 - 72*a^2*c^2*d + 72
*I*a^2*c*d^2 + 24*a^2*d^3)*e^(2*I*f*x + 2*I*e))*log(e^(2*I*f*x + 2*I*e) + 1))/(f*e^(8*I*f*x + 8*I*e) + 4*f*e^(
6*I*f*x + 6*I*e) + 6*f*e^(4*I*f*x + 4*I*e) + 4*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

giac [B]  time = 2.58, size = 904, normalized size = 6.41 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(c+d*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/3*(-6*I*a^2*c^3*e^(8*I*f*x + 8*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 18*a^2*c^2*d*e^(8*I*f*x + 8*I*e)*log(e^(2
*I*f*x + 2*I*e) + 1) + 18*I*a^2*c*d^2*e^(8*I*f*x + 8*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + 6*a^2*d^3*e^(8*I*f*x
+ 8*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 24*I*a^2*c^3*e^(6*I*f*x + 6*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 72*a^2
*c^2*d*e^(6*I*f*x + 6*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + 72*I*a^2*c*d^2*e^(6*I*f*x + 6*I*e)*log(e^(2*I*f*x +
2*I*e) + 1) + 24*a^2*d^3*e^(6*I*f*x + 6*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 36*I*a^2*c^3*e^(4*I*f*x + 4*I*e)*l
og(e^(2*I*f*x + 2*I*e) + 1) - 108*a^2*c^2*d*e^(4*I*f*x + 4*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + 108*I*a^2*c*d^2
*e^(4*I*f*x + 4*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + 36*a^2*d^3*e^(4*I*f*x + 4*I*e)*log(e^(2*I*f*x + 2*I*e) + 1
) - 24*I*a^2*c^3*e^(2*I*f*x + 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 72*a^2*c^2*d*e^(2*I*f*x + 2*I*e)*log(e^(2*
I*f*x + 2*I*e) + 1) + 72*I*a^2*c*d^2*e^(2*I*f*x + 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + 24*a^2*d^3*e^(2*I*f*x
+ 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 6*I*a^2*c^3*e^(6*I*f*x + 6*I*e) - 54*a^2*c^2*d*e^(6*I*f*x + 6*I*e) + 9
0*I*a^2*c*d^2*e^(6*I*f*x + 6*I*e) + 42*a^2*d^3*e^(6*I*f*x + 6*I*e) - 18*I*a^2*c^3*e^(4*I*f*x + 4*I*e) - 144*a^
2*c^2*d*e^(4*I*f*x + 4*I*e) + 198*I*a^2*c*d^2*e^(4*I*f*x + 4*I*e) + 72*a^2*d^3*e^(4*I*f*x + 4*I*e) - 18*I*a^2*
c^3*e^(2*I*f*x + 2*I*e) - 126*a^2*c^2*d*e^(2*I*f*x + 2*I*e) + 150*I*a^2*c*d^2*e^(2*I*f*x + 2*I*e) + 58*a^2*d^3
*e^(2*I*f*x + 2*I*e) - 6*I*a^2*c^3*log(e^(2*I*f*x + 2*I*e) + 1) - 18*a^2*c^2*d*log(e^(2*I*f*x + 2*I*e) + 1) +
18*I*a^2*c*d^2*log(e^(2*I*f*x + 2*I*e) + 1) + 6*a^2*d^3*log(e^(2*I*f*x + 2*I*e) + 1) - 6*I*a^2*c^3 - 36*a^2*c^
2*d + 42*I*a^2*c*d^2 + 16*a^2*d^3)/(f*e^(8*I*f*x + 8*I*e) + 4*f*e^(6*I*f*x + 6*I*e) + 6*f*e^(4*I*f*x + 4*I*e)
+ 4*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

maple [B]  time = 0.02, size = 360, normalized size = 2.55 \[ \frac {3 i a^{2} \left (\tan ^{2}\left (f x +e \right )\right ) c \,d^{2}}{f}-\frac {a^{2} d^{3} \left (\tan ^{4}\left (f x +e \right )\right )}{4 f}+\frac {2 i a^{2} \arctan \left (\tan \left (f x +e \right )\right ) d^{3}}{f}-\frac {a^{2} \left (\tan ^{3}\left (f x +e \right )\right ) c \,d^{2}}{f}+\frac {2 i a^{2} \left (\tan ^{3}\left (f x +e \right )\right ) d^{3}}{3 f}+\frac {i a^{2} \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c^{3}}{f}-\frac {3 a^{2} \left (\tan ^{2}\left (f x +e \right )\right ) c^{2} d}{2 f}+\frac {a^{2} \left (\tan ^{2}\left (f x +e \right )\right ) d^{3}}{f}-\frac {a^{2} c^{3} \tan \left (f x +e \right )}{f}+\frac {6 a^{2} \tan \left (f x +e \right ) c \,d^{2}}{f}-\frac {2 i a^{2} d^{3} \tan \left (f x +e \right )}{f}+\frac {6 i a^{2} c^{2} d \tan \left (f x +e \right )}{f}+\frac {3 a^{2} \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c^{2} d}{f}-\frac {a^{2} \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) d^{3}}{f}-\frac {3 i a^{2} \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c \,d^{2}}{f}-\frac {6 i a^{2} \arctan \left (\tan \left (f x +e \right )\right ) c^{2} d}{f}+\frac {2 a^{2} \arctan \left (\tan \left (f x +e \right )\right ) c^{3}}{f}-\frac {6 a^{2} \arctan \left (\tan \left (f x +e \right )\right ) c \,d^{2}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^2*(c+d*tan(f*x+e))^3,x)

[Out]

3*I/f*a^2*tan(f*x+e)^2*c*d^2-1/4/f*a^2*d^3*tan(f*x+e)^4+2*I/f*a^2*arctan(tan(f*x+e))*d^3-1/f*a^2*tan(f*x+e)^3*
c*d^2+2/3*I/f*a^2*tan(f*x+e)^3*d^3+I/f*a^2*ln(1+tan(f*x+e)^2)*c^3-3/2/f*a^2*tan(f*x+e)^2*c^2*d+1/f*a^2*tan(f*x
+e)^2*d^3-a^2*c^3*tan(f*x+e)/f+6/f*a^2*tan(f*x+e)*c*d^2-2*I/f*a^2*d^3*tan(f*x+e)+6*I/f*a^2*c^2*d*tan(f*x+e)+3/
f*a^2*ln(1+tan(f*x+e)^2)*c^2*d-1/f*a^2*ln(1+tan(f*x+e)^2)*d^3-3*I/f*a^2*ln(1+tan(f*x+e)^2)*c*d^2-6*I/f*a^2*arc
tan(tan(f*x+e))*c^2*d+2/f*a^2*arctan(tan(f*x+e))*c^3-6/f*a^2*arctan(tan(f*x+e))*c*d^2

________________________________________________________________________________________

maxima [A]  time = 0.52, size = 217, normalized size = 1.54 \[ -\frac {3 \, a^{2} d^{3} \tan \left (f x + e\right )^{4} + {\left (12 \, a^{2} c d^{2} - 8 i \, a^{2} d^{3}\right )} \tan \left (f x + e\right )^{3} + {\left (18 \, a^{2} c^{2} d - 36 i \, a^{2} c d^{2} - 12 \, a^{2} d^{3}\right )} \tan \left (f x + e\right )^{2} - 12 \, {\left (2 \, a^{2} c^{3} - 6 i \, a^{2} c^{2} d - 6 \, a^{2} c d^{2} + 2 i \, a^{2} d^{3}\right )} {\left (f x + e\right )} - 12 \, {\left (i \, a^{2} c^{3} + 3 \, a^{2} c^{2} d - 3 i \, a^{2} c d^{2} - a^{2} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + {\left (12 \, a^{2} c^{3} - 72 i \, a^{2} c^{2} d - 72 \, a^{2} c d^{2} + 24 i \, a^{2} d^{3}\right )} \tan \left (f x + e\right )}{12 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(c+d*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

-1/12*(3*a^2*d^3*tan(f*x + e)^4 + (12*a^2*c*d^2 - 8*I*a^2*d^3)*tan(f*x + e)^3 + (18*a^2*c^2*d - 36*I*a^2*c*d^2
 - 12*a^2*d^3)*tan(f*x + e)^2 - 12*(2*a^2*c^3 - 6*I*a^2*c^2*d - 6*a^2*c*d^2 + 2*I*a^2*d^3)*(f*x + e) - 12*(I*a
^2*c^3 + 3*a^2*c^2*d - 3*I*a^2*c*d^2 - a^2*d^3)*log(tan(f*x + e)^2 + 1) + (12*a^2*c^3 - 72*I*a^2*c^2*d - 72*a^
2*c*d^2 + 24*I*a^2*d^3)*tan(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 5.06, size = 223, normalized size = 1.58 \[ \frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a^2\,d^3}{2}+\frac {a^2\,d^2\,\left (d+c\,3{}\mathrm {i}\right )}{2}+\frac {a^2\,c\,d\,\left (d+c\,1{}\mathrm {i}\right )\,3{}\mathrm {i}}{2}\right )}{f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (a^2\,c^3\,2{}\mathrm {i}+6\,a^2\,c^2\,d-a^2\,c\,d^2\,6{}\mathrm {i}-2\,a^2\,d^3\right )}{f}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a^2\,d^3\,1{}\mathrm {i}+a^2\,d^2\,\left (d+c\,3{}\mathrm {i}\right )\,1{}\mathrm {i}-a^2\,c^2\,\left (3\,d+c\,1{}\mathrm {i}\right )\,1{}\mathrm {i}-3\,a^2\,c\,d\,\left (d+c\,1{}\mathrm {i}\right )\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {a^2\,d^3\,1{}\mathrm {i}}{3}+\frac {a^2\,d^2\,\left (d+c\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{3}\right )}{f}-\frac {a^2\,d^3\,{\mathrm {tan}\left (e+f\,x\right )}^4}{4\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)^2*(c + d*tan(e + f*x))^3,x)

[Out]

(tan(e + f*x)^2*((a^2*d^3)/2 + (a^2*d^2*(c*3i + d))/2 + (a^2*c*d*(c*1i + d)*3i)/2))/f + (log(tan(e + f*x) + 1i
)*(a^2*c^3*2i - 2*a^2*d^3 - a^2*c*d^2*6i + 6*a^2*c^2*d))/f - (tan(e + f*x)*(a^2*d^3*1i + a^2*d^2*(c*3i + d)*1i
 - a^2*c^2*(c*1i + 3*d)*1i - 3*a^2*c*d*(c*1i + d)))/f + (tan(e + f*x)^3*((a^2*d^3*1i)/3 + (a^2*d^2*(c*3i + d)*
1i)/3))/f - (a^2*d^3*tan(e + f*x)^4)/(4*f)

________________________________________________________________________________________

sympy [B]  time = 1.35, size = 389, normalized size = 2.76 \[ - \frac {2 i a^{2} \left (c - i d\right )^{3} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac {6 a^{2} c^{3} - 36 i a^{2} c^{2} d - 42 a^{2} c d^{2} + 16 i a^{2} d^{3} + \left (18 a^{2} c^{3} e^{2 i e} - 126 i a^{2} c^{2} d e^{2 i e} - 150 a^{2} c d^{2} e^{2 i e} + 58 i a^{2} d^{3} e^{2 i e}\right ) e^{2 i f x} + \left (18 a^{2} c^{3} e^{4 i e} - 144 i a^{2} c^{2} d e^{4 i e} - 198 a^{2} c d^{2} e^{4 i e} + 72 i a^{2} d^{3} e^{4 i e}\right ) e^{4 i f x} + \left (6 a^{2} c^{3} e^{6 i e} - 54 i a^{2} c^{2} d e^{6 i e} - 90 a^{2} c d^{2} e^{6 i e} + 42 i a^{2} d^{3} e^{6 i e}\right ) e^{6 i f x}}{3 i f e^{8 i e} e^{8 i f x} + 12 i f e^{6 i e} e^{6 i f x} + 18 i f e^{4 i e} e^{4 i f x} + 12 i f e^{2 i e} e^{2 i f x} + 3 i f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**2*(c+d*tan(f*x+e))**3,x)

[Out]

-2*I*a**2*(c - I*d)**3*log(exp(2*I*f*x) + exp(-2*I*e))/f + (6*a**2*c**3 - 36*I*a**2*c**2*d - 42*a**2*c*d**2 +
16*I*a**2*d**3 + (18*a**2*c**3*exp(2*I*e) - 126*I*a**2*c**2*d*exp(2*I*e) - 150*a**2*c*d**2*exp(2*I*e) + 58*I*a
**2*d**3*exp(2*I*e))*exp(2*I*f*x) + (18*a**2*c**3*exp(4*I*e) - 144*I*a**2*c**2*d*exp(4*I*e) - 198*a**2*c*d**2*
exp(4*I*e) + 72*I*a**2*d**3*exp(4*I*e))*exp(4*I*f*x) + (6*a**2*c**3*exp(6*I*e) - 54*I*a**2*c**2*d*exp(6*I*e) -
 90*a**2*c*d**2*exp(6*I*e) + 42*I*a**2*d**3*exp(6*I*e))*exp(6*I*f*x))/(3*I*f*exp(8*I*e)*exp(8*I*f*x) + 12*I*f*
exp(6*I*e)*exp(6*I*f*x) + 18*I*f*exp(4*I*e)*exp(4*I*f*x) + 12*I*f*exp(2*I*e)*exp(2*I*f*x) + 3*I*f)

________________________________________________________________________________________